package com.xunwulian.base.dao;


import com.xunwulian.base.entity.Page;
import com.xunwulian.base.entity.SmsGprsBalanceEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

@Mapper
public interface SmsGprsBalanceDao {


    /**
     * 列表(全部)
     */
    List<SmsGprsBalanceEntity> listPage(@Param("page") Page page,
                                        @Param("searchKey") String searchKey,
                                        @Param("userId") String userId);


    int insert4Import(SmsGprsBalanceEntity entity);

    SmsGprsBalanceEntity loadByDateMsisdn(@Param("msisdn") String msisdn,
                                          @Param("date") String date);

    void update4Import(@Param("entity") SmsGprsBalanceEntity entity);

    /*
     * 按日期查询SMS短信和GPRS历史使用情况
     */
    SmsGprsBalanceEntity queryUsedByDate(@NotNull @Param("msisdn") String msisdn,
                                         @Param("startDate") Date startDate,
                                         @Param("endDate") Date endDate);
}
